composetable: Don't use GSlice for big blobs
authorMatthias Clasen <mclasen@redhat.com>
Tue, 2 Feb 2021 06:15:00 +0000 (01:15 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 2 Feb 2021 16:55:00 +0000 (11:55 -0500)
This just doesn't make sense. This will use malloc
anyway, so just call malloc directly.

gtk/gtkcomposetable.c

index add4cf4b6625778535f1565d06513e7d25681a9e..cfb51e6e814d7fc40aaa2641ece03aa2289076eb 100644 (file)
@@ -503,11 +503,11 @@ gtk_compose_table_serialize (GtkComposeTable *compose_table,
   g_return_val_if_fail (index_stride > 0, NULL);
 
   length = strlen (header);
-  total_length = length + sizeof (guint16) * (3 +  index_stride * n_seqs);
+  total_length = length + sizeof (guint16) * (3 + index_stride * n_seqs);
   if (count)
     *count = total_length;
 
-  p = contents = g_slice_alloc (total_length);
+  p = contents = g_malloc (total_length);
 
   memcpy (p, header, length);
   p += length;
@@ -689,7 +689,7 @@ gtk_compose_table_save_cache (GtkComposeTable *compose_table)
     }
 
 out_save_cache:
-  g_slice_free1 (length, contents);
+  g_free (contents);
   g_free (path);
 }